#include <iostream>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>

void handler(int sig)
{
	std::cout << "I Get a signal: " << sig << std::endl; 
}

int main()
{
	struct sigaction act, oact;
	act.sa_handler = handler;
	sigaction(SIGINT, &act, &oact);
	while(true)
	{
		sleep(1);
		std::cout << "I am a process, my pid:" << getpid() << std::endl;
	}
	return 0;
}
